package com.example.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.*;

/**
 * ClassName:ThreadPoolConfig
 * Description:
 *
 * @author Yql
 * @version 1.0
 * @Create 2024/5/28
 **/

@Configuration
public class OriginThreadPoolConfig {

    @Bean(name = "origin_message-produce")
    public ThreadPoolExecutor origin_MessageConsumer() {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 10, 1000, TimeUnit.MILLISECONDS,
                new SynchronousQueue<Runnable>(), Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());;
        return executor;
    }

}
